package freespiritsocial.io.user.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import freespiritsocial.io.user.R
import freespiritsocial.io.user.data.model.UploadPostEvent
import freespiritsocial.io.user.databinding.ItemUploadPostBinding
import freespiritsocial.io.user.ext.setAdapterAnimation
import java.util.*

/**
 * 添加标签适配器
 */
class UploadPostAdapter(
    data: ArrayList<UploadPostEvent> = arrayListOf(),
    layoutResIdRes: Int = R.layout.item_upload_post
):
    BaseQuickAdapter<UploadPostEvent,BaseDataBindingHolder<ItemUploadPostBinding>>(layoutResIdRes,data) {
    init {
        addChildClickViewIds(R.id.tv_unpublish,R.id.tv_republish)
        setAdapterAnimation(0)
    }

    override fun convert(holder: BaseDataBindingHolder<ItemUploadPostBinding>,item: UploadPostEvent) = with(holder.dataBinding) {
        this?.data = item
    }
}